import Vue from 'vue'

Vue.directive('highlight', {
  inserted(el) {
    /* eslint-disable */
    const blocks = el.querySelectorAll('pre code')
    blocks.forEach((block) => {
      hljs.highlightBlock(block)
    })
  },
  componentUpdated(el) {
    const blocks = el.querySelectorAll('pre code')
    blocks.forEach((block) => {
      hljs.highlightBlock(block)
    })
  }
})
